/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************/
#include "registerprins.h"

RegisterPrIns::RegisterPrIns()
{
    jointFlag = 0;
    prValueList.resize(6);
    memset(prValueList.begin(),0,6);
}


QDataStream& operator <<(QDataStream &out,RegisterPrIns &myVector)
{
    out << myVector.jointFlag;
    out << (quint32)myVector.prValueList.size();

    out << myVector.prValueList;

    qDebug() <<"**ins***"<<myVector.jointFlag<<"***size**"<<myVector.prValueList.size()<<
               "****pr***"<<myVector.prValueList<<endl;
    return out;
}

QDataStream& operator >>(QDataStream &in,RegisterPrIns &myVector)
{
    quint32 tmpSize;
    in >> myVector.jointFlag;
    in >> tmpSize;

    myVector.prValueList.resize(tmpSize);

    in >> myVector.prValueList;

    return in;
}

RegisterOfPr::RegisterOfPr()
{
    prData.resize(REG_SIZE);

    for(int i = 0; i < REG_SIZE;i++)
    {
        prData[i].jointFlag = 0;
    }
}

QDataStream& operator <<(QDataStream &out,RegisterOfPr &myVector)
{
    out << (quint32)myVector.prData.size();
    qDebug() <<"***prData***"<<myVector.prData.size();
    for(int i = 0; i < myVector.prData.size();i++)
    {
        out << myVector.prData[i];
    }


    return out;
}

QDataStream& operator >>(QDataStream &in,RegisterOfPr &myVector)
{
    quint32 tmpSize;
    in >> tmpSize;

    myVector.prData.resize(tmpSize);
    for(int i = 0; i < myVector.prData.size();i++)
    {
        in >> myVector.prData[i];
    }
    return in;
}
